home *** CD-ROM | disk | FTP | other *** search
/ Revista CD Expert 37 / CD Expert nº 37.iso / LastCall / lastcall.exe / stuff / recipe.dxr / 00016_Alphabet listing.ls < prev    next >
Encoding:
Text File  |  2000-03-23  |  1.4 KB  |  64 lines

  1. property pSpr, pSolidArrow, pHilightArrow, pLastChar
  2. global gScroller, gLastLetter
  3.  
  4. on beginSprite me
  5.   pSpr = sprite(me.spriteNum)
  6.   pSolidArrow = sprite(me.spriteNum + 1)
  7.   pHilightArrow = sprite(me.spriteNum + 2)
  8.   if voidp(gLastLetter) then
  9.     setIt(me, 1)
  10.   else
  11.     setIt(me, gLastLetter)
  12.   end if
  13.   mouseLeave(me)
  14. end
  15.  
  16. on mouseDown me
  17.   setIt(me, PointToChar(pSpr, the clickLoc))
  18.   gScroller.pLastLine = VOID
  19. end
  20.  
  21. on mouseLeave me
  22.   pHilightArrow.locH = -50
  23. end
  24.  
  25. on mouseWithin me
  26.   if paused() then
  27.     exit
  28.   end if
  29.   thisChar = PointToChar(pSpr, the mouseLoc)
  30.   if thisChar > 0 then
  31.     pHilightArrow.locH = pSpr.locH + charPosToLoc(pSpr.member, thisChar).locH
  32.     if thisChar <> pLastChar then
  33.       if pLastChar then
  34.         pSpr.member.char[pLastChar].color = black()
  35.       end if
  36.       pSpr.member.char[thisChar].color = red()
  37.       pSpr.member.char[gLastLetter].color = blue()
  38.       pLastChar = thisChar
  39.     end if
  40.   end if
  41. end
  42.  
  43. on setIt me, X
  44.   if paused() then
  45.     exit
  46.   end if
  47.   if not isText(pSpr) then
  48.     exit
  49.   end if
  50.   gLastLetter = X
  51.   pSolidArrow.locH = pSpr.locH + charPosToLoc(pSpr.member, X).locH
  52.   pSpr.member.color = black()
  53.   if hasRecipes(pSpr.member.text.char[X]) then
  54.     pSpr.member.char[X].color = blue()
  55.   else
  56.     pSpr.member.char[X].color = red()
  57.   end if
  58.   cursor(4)
  59.   pageSound()
  60.   updateStage()
  61.   activeRecipes = sendSprite(gScroller, #mRefresh, X, pSpr.member.char[X])
  62.   cursor(-1)
  63. end
  64.